package com.carrental.service;

import java.util.List;

import com.carrental.dao.CarListDao;
import com.carrental.entity.CarList;

//逻辑处理
public class CarListService {
	
	CarListDao carListDao;
	
	public CarListService() throws Exception {
		carListDao = new CarListDao();
	}
	
	//添加
	public int add(CarList carList) throws Exception {
		return carListDao.add(carList);
	}
	
	//删除
	public int delete(String id) throws Exception {
		return carListDao.delete(id);
	}
	
	//更新
	public int update(CarList carList) throws Exception {
		return carListDao.update(carList);
	}
	
	//查询全部
	public List<CarList> selectAll() throws Exception {
		return carListDao.selectAll();
	}
	
	//根据id查询
	public CarList selectById(String id) throws Exception {
		return carListDao.selectById(id);
	}
	
	//查询还有库存的
	public List<CarList> selectHaveNumber() throws Exception {
		return carListDao.selectHaveNumber();
	}

}
